package demo1224.homework;

import java.io.File;

public class Fangaoxiang {
    public static void main(String[] args) {
        File file=new File("a");
        delete(file);

    }

    public static void delete(File file) {
        if(file.isFile()){
            file.delete();
            return;

        }
        File [] files=file.listFiles();
        for (File file1 : files) {
            delete(file1);
        }
        file.delete();

    }
}
